package irsystem.model;

import java.util.Vector;

public class IndexTable {

    /* atribut-atribut yang dimiliki oleh kelas IndexTable */
        private int row;            //number of rows
        private int column;         //number of columns
        private double[] data;

    /* constructor - user defined contructor, no default contructor */
        public IndexTable (int row, int column) {
            this.row = row;
            this.column = column;
            this.data = new double[this.row*this.column];
        }

    /* setter */
        public void setCell (int row, int column, double value) {
            this.data[(this.column * row) + column] = value;
        }

    /* getter */
        public int getRow () {
            return (this.row);
        }
        public int getColumn () {
            return (this.column);
        }
        public double[] getData() {
            return (this.data);
        }
        public double getCell (int row, int column) {
            return (this.data[(this.column * row) + column]);
        }

     /* method-method lain yang diliki oleh kelas IndexTable */
        public void clear() {
            for (int i = 0; i < this.column*this.row; ++i) data[i] = 0d;
        }
}
